package com.hu.mapper;

import com.hu.pojo.Dept;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper

public interface DeptMapper {

    //查询全部部门
    @Select("select * from tlias.dept")
    List<Dept> list();

    //删除部门
    @Delete("delete from tlias.dept where id = #{id}")
    void deteleById(Integer id);

    //新增部门
    @Insert("insert into tlias.dept(name, create_time, update_time) VALUES (#{name},#{createTime},#{updateTime})")
    void insert(Dept dept);


    //修改部门
    @Select("select  * from tlias.dept where id = #{id}")
    Dept getByID(Integer id);
    @Update("update tlias.dept set name=#{name}, create_time=#{createTime}, update_time = #{updateTime} where id=#{id}")
    void update(Dept dept);
}
